Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box: support realtime event stream #222

Closed
wants to merge 2 commits into from

Conversation

boneskull
Copy link

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

  • Enhancement: Adds a checkbox to the Box node (disabled by default) which will, if checked, enable the box in Node to monitor the event log via long polling instead of interval-based polling. This enables (roughly) real-time events to come down the pipe.
  • Enhancement: Adds the ability to change the interval (not long-polling) time, which was hardcoded to 10 minutes.
  • Fix: a bug wherein a token refresh error could eat the error text.
  • Refactor: some of BoxNodeIn for DRY

I could spend a lot longer with the tests. I'm also experiencing an unrelated test failure locally in the Instagram node.

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the mailing list/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@boneskull
Copy link
Author

I can also split this PR up, if needed.

@@ -224,7 +287,7 @@ describe('box nodes', function() {
var onStub = sinon.stub(box, 'on').callsFake(function(event, cb) {
var res = onFunction.apply(box, arguments);
onStub.restore();
box.emit('input', {}); // trigger poll
box.emit('check-events', {}); // trigger poll
Copy link
Author

@boneskull boneskull Jun 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it best to rename this event, because it's confusing. This is not a real input event; the box in Node has no inputs.

box/box.js Outdated
return;
}
if (!(data.entries && data.entries.length)) {
node.fail(new Error('Invalid response from Box'));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, need i18n

@boneskull
Copy link
Author

still working out some kinks

@coveralls
Copy link

coveralls commented Jun 28, 2018

Coverage Status

Coverage decreased (-0.02%) to 72.266% when pulling 6b0b23c on boneskull:box-real-time into 612522d on node-red:master.

@boneskull
Copy link
Author

I'm going to withdraw this, as other changes I'm making supercede it.

@boneskull boneskull closed this Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants